package cn.trip.service.root;


import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.trip.dao.root.RootMapper;
import cn.trip.pojo.Trip_product;
import cn.trip.pojo.Trip_root;

@Service
public class RootServiceImpl implements RootService {

	@Resource
	private RootMapper rootMapper;
	
	@Override
	public Trip_root getRootList(String roleCode, String rolePassword) {
		return rootMapper.getRootList(roleCode, rolePassword);
	}


	@Override
	public boolean modify(String roleCode, String rolePassword,String roleName) {
		boolean flag = false;
		if(rootMapper.modify(rolePassword, roleCode,roleName)>0){
			flag = true;
		}
		return flag;
	}


	@Override
	public List<Trip_product> getList(String createBy, Integer currentPageNo,
			Integer pageSize) {
		return rootMapper.getList(createBy, (currentPageNo-1)*pageSize, pageSize);
	}


	@Override
	public int getListCount(String createBy) {
		return rootMapper.getListCount(createBy);
	}


	@Override
	public Trip_product getProduct(Integer id) {
		return rootMapper.getProduct(id);
	}


	@Override
	public boolean updateStatus(Integer status, Integer id) {
		boolean flag = false;
		if(rootMapper.updateStatus(status, id)>0){
			flag = true;
		}
		return flag;
	}


	@Override
	public List<Trip_product> getFieldList() {
		return rootMapper.getFieldList();
	}


	@Override
	public List<Trip_product> getHotelList() {
		return rootMapper.getHotelList();
	}


	@Override
	public List<Trip_product> getCaterList() {
		return rootMapper.getCaterList();
	}


}
